extends "../../azurlane_ctrl/AzurItem.gd"
func init():
	.init()
	name = "[稀有]纳尔逊的旗语"
	info = "<唯一>战斗开始时，与携带者同阵营的所有友军获得携带者15%的炮击雷击航空血量攻速加成\n[color=#DC143C]同时装备两件时可升级[/color]"
	price = 300
	att.maxHp = 500
	att.def = 30
	
func _connect():
	._connect()
	sys.main.connect("onBattleStart",self,"onBattleStart")

var p = 0.15
func onBattleStart():
	if utils.inBattle(masCha):
		for i in masCha.getAllChas(2):
			if i.hasBuff("b_naerxun") == null and i != masCha and i.camp == masCha.camp:
				masCha.castBuff(i, b_naerxun.new(p))

func upgrade():
	name = "[color=#FFFF00][史诗]纳尔逊的旗语"
	info = "<唯一>战斗开始时，与携带者同阵营的所有友军获得携带者20%的炮击雷击航空血量攻速冷却加成"
	att.maxHp = 500
	att.def = 45
	p = 0.2

class b_naerxun:
	extends "../../azurlane_ctrl/AzurBuff.gd"
	var p = 0.15
	func _init(p = 0.15):
		attInit()
		id = "b_naerxun"
		buffName = "纳尔逊的旗语"
		dispel = 2
		self.p = p
	func _connect():
		att.atk = casCha.att.atk * p
		att.mgiAtk = casCha.att.mgiAtk * p
		att.maxHp = casCha.att.maxHp * p
		att.air = casCha.att.air * p
		att.spd = casCha.att.spd * p